<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <th:block th:include="public/include :: header" />
 	<meta name="keywords" th:content="${biz.cmsCate.keyWord}">
	<meta name="description" th:content="${biz.cmsCate.cateDesc}">
    <title>[[${biz.cmsCate.cateTitle}]]</title>
    
    <th:block th:include="public/include :: swiper-css" />
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/headfoot.css" />
    <link rel="stylesheet" href="/css/index.css">
    
    <link rel="stylesheet" href="/css/second.css">
</head>

<body class="huibg">
    <!--头部部分-->
    <div class="heads">
    </div>
    
    <div class="main-md">
        <div class="bgff pad20">
        	<div class="xiu jians">
                <div class="xiu_lf">
                    <div class="se_tit">
                        <h2 class="fnt_18 col_666">最新信息</h2>
                    </div>
                    <div class="jian ">
                        <ul>
                        	<li th:each="cont,st : ${biz.topNews}">
		                    	<a th:href="@{'/cont/detail/'+${cont.contId}+'.html'}" target="_blank">
		                            <div class="jian_img">
		                                <img th:src="${cont.contShortPic}" th:alt="${cont.contTitle}" th:attr="onerror='src=\'\''">
		                            </div>
		                            <div class="jian_text">
		                                <div class="jian_top">
		                                    <h4 class="fnt_18 col_333 textfull1">[[${cont.contTitle}]]</h4>
		                                    <span class="fnt_14 col_666" th:text="${#dates.format(cont.contPubDatetime,'yyyy-MM-dd')}"></span>
		                                </div>
		                                <p class="fnt_14 col_666 textfull2" th:text="${cont.contDesc}"></p>
		                                <span class="fnt_16 cent col_lan"> 点击浏览 </span>
		                        </a>
		                        <div style="clear:both"></div>
		                     </li>
                        </ul>
                    </div>
                </div>
                <div class="xiu_rt">
                    <div class="se_tit">
                        <h2 class="fnt_18 col_666">教育视频</h2>
                    </div>
                    <div class="ship">
                        <ul>
                        	<li th:each="eduVideo,st : ${biz.topEduVideos}">
			                    <a th:href="|javascript:playVideo(${eduVideo.cevId})|">
			                        <img th:src="${eduVideo.videoImg}" th:alt="${eduVideo.cevDesc}" style="width: 150px;height: 115px;">
			                        <div class="ship_hide">
			                            <i class="iconfont icon-bofang2 col_fff"></i>
			                            <h4 class="col_fff cent fnt_14">[[${eduVideo.cevTitle}]]</h4>
			                            <p></p>
			                        </div>
			                    </a>
		                    </li>
                        </ul>
                    </div>
                </div>
            </div>
        
        	<!-- 分页工作动态 -->    
            <div class="pt_30">
                <div class="se_tit">
                    <h2 class="fnt_18 col_666">工作动态</h2>
                </div>
                <div class="main_rt_lists">
                    <ul id="pageData">
                    </ul>
                    <div  id="pageNav">
                        <div class='mypage  ph_dis'>
                            <a href="#">上一页</a>
                            <a href="#" class=linking>1</a>
                            <a href="#" class=unlink>2</a>
                            <a href="#" class=unlink>3</a>
                            <a href="#" class=unlink>4</a>
                            <a href="#">下一页</a>
                        </div>
                        <div class='mypage  pc_dis'>
                            <a href="#">&lt;</a>
                            1/10
                            <a href="#">&gt;</a>
                        </div>
                    </div>
                </div>
            </div>
            
        </div>
    </div>
    <!-- 友情链接 -->
    <div class="flink">
    </div>
    <!--页尾-->
    <div class="foots">
    </div>
    
    <th:block th:include="public/include :: footer" />
    <th:block th:include="public/include :: swiper-js" />
    <th:block th:include="public/include :: layer-js" />
    <div th:replace="public/include :: SuperSlide-js" ></div>
    <script src="/js/index.js"></script>
    <script>
	    var cateId = [[${biz.subCate1.cateId}]];
    	var pageSize = [[${biz.subCate1.showPageCount}]];
    	var pageDataUrl = ctx + "cate/pgdata/"+cateId+"/"+pageSize+"/";
    	var defNewImg = '[[${biz.siteInfo.defaultContPic}]]';

    	var swiper = new Swiper('#banner', {
            autoplay: 3000,
            speed: 500,
            loop: true,
            lazyLoading: true,
            // 如果需要分页器
            pagination: '.swiper-pagination',
            paginationClickable: true
        });
        var windowWidth = $(window).width();
        if (windowWidth < 768) {

        }
        if (windowWidth >= 768) {

        }
        $('.main_top_tit span').click(function () {
            var liindex = $('.main_top_tit span').index(this);
            console.log(liindex);
            $(this).addClass('active').siblings().removeClass('active');
            $('.main_rt_con .main_rt_item').eq(liindex).fadeIn(150).siblings(".main_rt_item").hide();
        });
        jQuery(".picMarquee-left").slide({
            mainCell: ".bd ul",
            autoPlay: true,
            effect: "leftMarquee", vis: 7, interTime: 50, trigger: "click"
        });
        
        $(function() {
	        $(".heads").load("/head",function(){
	        	 //栏目选中
		        $(".main-md ul li").removeClass("active");
		        //$("#nav[[${biz.cmsCate.cateCode}]]").addClass("active");
	        });
	        $(".foots").load("/foot.html");
	        $(".flink").load("/flink.html");
	        
	        //默认新闻图
	        $(".jians img").attr("onerror","src='"+defNewImg+"'");
	        
	        //加载数据
	 	    loadData(1);
        });
        
        //播放视频
        function playVideo(cevId){
       	 var openUrl = ctx+"page/vplay/"+cevId;
       	 //弹出框
       	 layer.open({
       		  type: 2,
       		  title: '视频播放',
       		  shadeClose: false,
       		  shade: 0.8,
       		  area: ['90%', '90%'],
       		  content: openUrl //iframe的url
       	 }); 
        }
        
        
        //加载数据
        function loadData(pagenum){
      		//加载数据
      		$.get(pageDataUrl+pagenum,{},function(data){
      			console.log("--resp--"+data);
      			if(data.code==500){
      				console.log("出错了");
      			}else if(data.code==100){//成功
      				//循环赋值
      				$("#pageData").html("");
      			
      				var itemHtml="";
      				$.each( data.data.list, function(i, item){
      					/**itemHtml='<li><a href="/cont/detail/'+item.contId+'">';
      					itemHtml+='<div class="jian_img"><img src="'+item.contShortPic+'" alt="'+item.contKeyWord+'" onerror="src=\''+defNewImg+'\'" ></div>';
      					itemHtml+='<div class="jian_text"><div class="jian_top">';
      					itemHtml+='<h4 class="fnt_18 col_333 textfull1">'+item.contTitle+"</h4>";
      					itemHtml+='<span class="fnt_14 col_666">'+item.contPubDatetime+'</span>';
      					itemHtml+='</div><p class="fnt_14 col_666 textfull2">'+item.contDesc+'</p>';
      					itemHtml+='<span class="fnt_16 cent col_lan"> 点击浏览 </span></div></a></li>';
      					**/
      					itemHtml=' <li><a href="/cont/detail/'+item.contId+'.html">';
      					itemHtml+=' <div class="fnt_18 col_444 main_rt_lf textfull1">'+item.contTitle+'</div> ';
      					itemHtml+=' <div class="fnt_14 col_666 main_rt_rt">'+item.contPubDatetime+'</div> ';
      					itemHtml+=' </a><div style="clear:both"></li>';
                      
      					console.log("输出："+itemHtml);
      		    		$("#pageData").append(itemHtml);
      		    	});
      	    		//分页条
      	    		buildPageBar(data.data);
      			}else{//失败
      				console.log("...");
      			}
      		});
      	}
        	
         function buildPageBar(barData){
      	   var item = "";
      	   item +='<div class="mypage  ph_dis">';
      	   item +='<a href="javascript:loadData('+(barData.prePage==0?"1":barData.prePage)+')" id="previd">上一页</a>';
      	   
      	   console.log("分页条："+barData.navigatepageNums.length);
      	   for (let i = 0; i < barData.navigatepageNums.length; i++) {
      		   var pn = barData.navigatepageNums[i];
                 item +='<a href="javascript:loadData('+pn+')" class="'+( pn==barData.pageNum?"linking":"unlink" )+'">'+pn+'</a>';
             }
      	   
      	   item +='<a href="javascript:loadData('+(barData.nextPage==0?"1":barData.nextPage)+')"" id="nextid">下一页</a>';
      	   item +='</div>';
      	   console.log("分页条的bar："+item);
      	   $("#pageNav").html(item);
         }
        
    </script>
</body>

</html>